package com.guchenbo.example.json;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.guchenbo.example.Person;

/**
 * @Author gucb
 * @Date 2017/6/14.
 */
public class JSONTest {
    public static void main(String[] args) {

        Person person = Person.person();
        System.out.println(JSON.toJSONString(person));

        int features = SerializerFeature.WRITE_MAP_NULL_FEATURES | SerializerFeature.QuoteFieldNames.getMask();
        System.out.println(JSON.toJSONString(person, features));
    }
}
